package StringAlgorithms;

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;

class Solver1354
{	int fw=0,bw=0;
	int B=52,M=520000;
	int[] Mod;
	char[] Rec;
	
	public void Input() throws IOException
	{	StreamTokenizer in=new StreamTokenizer(new InputStreamReader(System.in));
		in.nextToken();Rec=in.sval.toCharArray();
		Mod=new int[Rec.length];
	}
	private int Cv(char c)
	{	if (c>='a' && c<='z') return (c-'a');
		else return ((int)(c-'A')+26);
	}
	public void Solve()
	{	if (Rec.length==1)
			Output(1);
		else
		{	Mod[0]=1;
			int[] TMP=new int[Rec.length];
			for (int i=1;i<Mod.length;i++)
				Mod[i]=(Mod[i-1]*B)%M;
			for (int i=0;i<Rec.length;i++)
			{	fw=(fw*B+Cv(Rec[i]))%M;
				bw=(bw*B+Cv(Rec[Rec.length-1-i]))%M;
				TMP[i]=bw;
			}
			for (int i=0;i<=Rec.length-1;i++)
				if (fw!=bw)
				{	fw=(fw-((Cv(Rec[i])*Mod[Rec.length-1-i])%M)+M)%M;
					bw=TMP[Rec.length-2-i];
				}
				else
				{	boolean ret=true;
					if (i==0) ret=false;
					else
					{	for (int j=0;j<=Rec.length-1-i;j++)
							if (Rec[i+j]!=Rec[Rec.length-1-j])
							{	ret=false;break;
							}
					}
					if (ret)
					{	Output(i);break;
					}
				}
		}
	}
	public void Output(int index)
	{	char[] Rs=new char[Rec.length+index];
		for (int i=0;i<Rec.length;i++)
			Rs[i]=Rec[i];
		for (int i=0;i<index;i++)
			Rs[Rec.length+i]=Rec[index-1-i];
		System.out.println(Rs);
	}
	public void main() throws IOException
	{	Input();
		Solve();
	}
}
public class P1354
{	public static void main(String[] args) throws IOException
	{	Solver1354 solver=new Solver1354();
		solver.main();
	}
}
